/*
 *****************************************************************************
 * Copyright 2004-2012 Aiti Ltd. All rights reserved.
 *****************************************************************************
 *  Change Activity:
 *  --------------------------------------------------------------------------
 *  Date      Author          Description
 *  --------------------------------------------------------------------------
 *  Jan 14, 2013 ThinhNV2  Initial Code drop.
 *****************************************************************************
 */
package com.aiti.c1202m.core.logger.log4j;

import java.util.HashMap;
import java.util.Map;

import com.aiti.c1202m.core.logger.AbstractLoggerFactory;
import com.aiti.c1202m.core.logger.IfLogger;

/**
 * <H3>Log4jLoggerFactory</H3>
 *
 * @author ThinhNV2
 * @since Jan 14, 2013
 */
public class Log4jLoggerFactory extends AbstractLoggerFactory {

	private static final Map cache = new HashMap();

	//***** Constructor *****
	//***** Public method *****

	/**
	 * getLogger
	 * @see com.nsk.common.trace.AbstractLoggerFactory#getLogger(java.lang.String)
	 */
	public IfLogger getLogger(String className) {
		synchronized (cache) {
			IfLogger _logger = (IfLogger) cache.get(className);
			if (_logger == null) {
				_logger = new Log4jLoggerAdapter(className);
				cache.put(className, _logger);
			}
			return _logger;
		}
	}

	//***** Protected method *****
	//***** Private method *****
	//***** Call back methods *****
	//***** Getter and Setter *****

}
